#pragma once

#include <logger/stream.hpp>

#include "Engine.hpp"




namespace Engine
{
	class EngineImpl : public IEngine
	{
	protected:

		EngineImpl(const EngineInfo& info);

	public:

		typedef boost::shared_ptr<EngineImpl>   ptr;
		friend ptr boost::make_shared<EngineImpl, EngineInfo>(EngineInfo const &);
		static ptr create(const EngineInfo& info);



		Input::Device::ptr inputDevice() const;
		Video::Device::ptr videoDevice() const;
		/*AudioDevicePtr audioDevice() const;

		DatabaseSystemPtr databaseSystem() const;
		ResourceSystemPtr resourceSystem() const;*/
		Ui::System::ptr uiSystem() const;
		Script::System::ptr scriptSystem() const;
		Entity::System::ptr entitySystem() const;

		/**
		 * Updates the Engine.
		 */
		void update();

		/**
		 * Update the size of the window.
		 * The input class needs this to calculate
		 * the relative mouse position.
		 */
		void resize(int width, int height);

		/**
		 * Change the window handle.
		 */
		void changeWindow(HWND window);

	private:

		logger::stream::ptr     m_logger;

		Video::Device::ptr      m_videoDevice;
		Input::Device::ptr      m_inputDevice;
		/*AudioDevicePtr      m_audioDevice;

		DatabaseSystemPtr   m_database;
		ResourceSystemPtr   m_resources;*/
		Ui::System::ptr         m_uiSystem;
		Script::System::ptr     m_scriptSystem;
		Entity::System::ptr     m_entitySystem;
	};
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
